package com.zqwh.xtool.converter;

import com.zqwh.xtool.domain.UserTemplatesVO;
import com.zqwh.xtool.greendao.db.User;

import java.util.ArrayList;
import java.util.List;

public class User2UserTemplatesVOConverter {
    public static UserTemplatesVO convert(User user){
        UserTemplatesVO userVO = new UserTemplatesVO();
        userVO.setUserId(user.getUserId());
        userVO.setTemplate_1(user.getTemplate_1());
        userVO.setTemplate_2(user.getTemplate_2());
        userVO.setTemplate_3(user.getTemplate_3());
        userVO.setTemplate_4(user.getTemplate_4());
        return userVO;
    }

    public static List<UserTemplatesVO> convert(List<User> userList){
        List<UserTemplatesVO> userVOList = new ArrayList<>();
        for (User user:userList){
            userVOList.add(convert(user));
        }
        return userVOList;
    }
}
